#ifndef _PROTOCOL_H_
#define _PROTOCOL_H_


#include <stdint.h>

typedef void (*protocol_callback_function)(uint8_t*, uint32_t);
typedef void (*cmd_callback_function)(uint8_t*, uint32_t);

#define PT_HEAD_H 0X55
#define PT_HEAD_L 0X7A
#define PT_VERSION 0X01

enum{
 PROTOCOL_CMD_UNKOWN = 0X00,
 PROTOCOL_CMD_0X04 = 0X04,
};

uint8_t protocol_pack_buf_init(protocol_callback_function ippcf, protocol_callback_function vppcf, protocol_callback_function ppsf);
uint8_t protocol_register_cmd(uint8_t cmd, cmd_callback_function ccf, uint8_t mode);
uint8_t protocol_pack_add(uint8_t cmd,uint8_t* data,uint16_t len,uint8_t repeats);
uint8_t protocol_receive_process(uint8_t* data,uint16_t len);
uint8_t protocol_polling_send(void);


#endif


